package com.ricchieri.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Table(name="scheduleCharterExpense")
public class ScheduleCharterExpense extends BaseEntity {
	private static final long serialVersionUID = 5810966170856833234L;
	
	@Column(name="amount", nullable=false)
	private Double amount;
	
	@Column(name="date", nullable=false)
	private Date date;
	
	@Column(name="description", nullable=false, length=100)
	private String description;

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "scheduleCharterExpenseType", nullable = false)
	private ScheduleCharterExpenseType scheduleCharterExpenseType;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "scheduleCharter", nullable = false, insertable = false, updatable = false)
	private ScheduleCharter scheduleCharter;
	
	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public ScheduleCharterExpenseType getScheduleCharterExpenseType() {
		return scheduleCharterExpenseType;
	}

	public void setScheduleCharterExpenseType(
			ScheduleCharterExpenseType scheduleCharterExpenseType) {
		this.scheduleCharterExpenseType = scheduleCharterExpenseType;
	}

	public ScheduleCharter getScheduleCharter() {
		return scheduleCharter;
	}

	public void setScheduleCharter(ScheduleCharter scheduleCharter) {
		this.scheduleCharter = scheduleCharter;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}